﻿#pragma once

#include <string>
#include <vector>
#include <stdexcept>
#include "../../../rectangularvectors.h"
#include "../../../tangible_filesystem.h"

//C# TO C++ CONVERTER NOTE: Forward class declarations:
namespace Server::MirForms::VisualMapInfo::Class { class Cell; }

namespace Server::MirForms::VisualMapInfo::Class
{
    class ReadMap
    {
    public:
        int Width = 0, Height = 0, MonsterCount = 0;
        std::vector<std::vector<Cell*>> Cells;
        long long LightningTime = 0, FireTime = 0;
        Bitmap *clippingZone;
        std::string mapFormat, mapFile;

        virtual ~ReadMap()
        {
            delete clippingZone;
        }

    private:
        unsigned char FindType(std::vector<unsigned char> &input);

        void LoadMapCellsv0(std::vector<unsigned char> &fileBytes);

        void LoadMapCellsv1(std::vector<unsigned char> &fileBytes);

        void LoadMapCellsv2(std::vector<unsigned char> &fileBytes);

        void LoadMapCellsv3(std::vector<unsigned char> &fileBytes);

        void LoadMapCellsv4(std::vector<unsigned char> &fileBytes);

        void LoadMapCellsv5(std::vector<unsigned char> &fileBytes);

        void LoadMapCellsv6(std::vector<unsigned char> &fileBytes);

        void LoadMapCellsv7(std::vector<unsigned char> &fileBytes);

        void LoadMapCellsv8(std::vector<unsigned char> &fileBytes);

        void LoadMapCellsv100(std::vector<unsigned char> &fileBytes);

    public:
        void Load();

        Cell *GetCell(Point *location);

        Cell *GetCell(int x, int y);
    };

    class Cell
    {
    public:
        static Cell *HighWall;
        static Cell *LowWall;
    };
}
